<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<#include "../common/head.ftl">

<#include "../common/modal.ftl">

<body class="gray-bg">

<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 class="modal-title" id="myModalLabel">添加会议记录</h4>
        </div>
        <div class="modal-body">
            <form class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label">选择设备</label>
                    <div class="col-sm-10">
                        <select name="deviceId" class="form-control"></select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">会议标题</label>
                    <div class="col-sm-10">
                        <input name="title" type="text" class="form-control"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">会议摘要</label>
                    <div class="col-sm-10">
                        <input name="meetingAbstract" type="text" class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">预计时长</label>
                    <div class="col-sm-10">
                        <select name="duration" class="form-control">
                            <option value="1">1小时</option>
                            <option value="2">2小时</option>
                            <option value="3">3小时</option>
                            <option value="4">4小时</option>
                            <option value="5">5小时</option>
                        </select>
                    </div>
                </div>
            </form>

        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary">添加</button>
        </div>
    </div>
</div>

<script src="${basePath}/js/jquery.min.js?v=2.1.4"></script>
<script src="${basePath}/js/common.js"></script>
<script src="${basePath}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${basePath}/js/bootstrap-datepicker.min.js"></script>

<script type="text/javascript">
    AsyncGet("${basePath}/recorder/getDeviceListByManagerId", null, function (value) {
        for (var i = 0; i < value.length; i++) {
            var option = $("<option></option>");
            $(option).attr("value", value[i].id);
            $(option).text(value[i].deviceName + "(" + value[i].deviceStatus + ")");
            $("[name='deviceId']").append(option);
        }
    })
    $(":button:last").click(function () {
        var param = getFormData($("form"));
        AsyncPost("${basePath}/recorder/addFileRecord", param, function (value) {
            if (value.code == 0) {
                window.location.href = "${basePath}/recorder/showFileRecord/" + value.data;
            } else {
                ShowMessage(value.msg);
            }
        })

    })
</script>
</body>
</html>